﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Net;
using System.Net.Sockets;
using System.IO;
using System.Threading;
using System.Windows.Forms;

namespace ClientApplication
{   
    public delegate void EventHandler(object sender, EventArgs e);
    public delegate void ResponseEventHandler(object sender, ResponseEventArgs e);
    public delegate void JudgingMessageEventHandler(object sender, JudgingMessageEventArgs e);
    public delegate void MessageEventHandler(object sender, string message);
    public delegate void CurrentJumpEventHandler(object sender, string ID, string name, string nationality, string jumpNumber);
    public delegate void ConnectedJudgesEventHandler(object sender, List<JudgeSerializable> jLS);
    public delegate void StringListEventHandler(object sender, List<string> stringList);
    public delegate void ContestPacketEventHandler(object sender, ContestPacket contestPacket);
            
    interface IClient
    {
        void Login(string id, string password, IPAddress serverIP, int timeout);
        void GettingAndHandlingMessagesJudge();
        void GettingAndHandlingMessagesAdmin();
        void SendingScore(string score);
        void SendRulesAsXML(SetupRulesArgs e);
        void SendContestantsToServer(CopyContestantsEventArgs e);
        void SendChosenJudgesToServer(ChosenJudgeEventArgs e);
        void SendConnectedJudgesRefresh();
        void SendJumpCode(string jumpCode);
        void SendFinishedContestsRequest();
        void SendViewContestRequest(Guid guid);

        event ResponseEventHandler LoggedIn;
        event JudgingMessageEventHandler GiveJudgingMessageToJudgeForm;
        event MessageEventHandler GiveMessageToAdminForm;
        event CurrentJumpEventHandler GiveActiveJumpToAdminForm;
        event MessageEventHandler GiveGeneralMessageToJudgeForm;
        event ConnectedJudgesEventHandler RefreshConnectedJudges;
        event MessageEventHandler GiveNewContestantMessageToAdminForm;
        event StringListEventHandler GiveFinishedContestsToAdminForm;
        event ContestPacketEventHandler GiveContestPacketToAdminForm;
        event MessageEventHandler UpdateJudgeTextBoxRed;
        event ContestPacketEventHandler GiveActiveContestPacketToAdminForm;
        event MessageEventHandler UpdateJudgeTextBoxGreen;
        event MessageEventHandler UpdateJudgeTextBoxWhite;
        event GeneralEventHandler ResetEndedCompetition;
    }
}
